<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>80386 Programmer's Reference Manual -- Opcode AAD</TITLE>
</HEAD>
<BODY STYLE="width:80ch">
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="AAA.htm"> AAA ASCII Adjust after Addition</A><BR>
<B>next:</B><A HREF="AAM.htm"> AAM ASCII Adjust AX after Multiply</A>
<P>
<HR>
<P>
<H1>AAD -- ASCII Adjust AX before Division</H1>

<PRE>
Opcode    Instruction    Clocks    Description

D5 0A     AAD            19        ASCII adjust AX before division
</PRE>

<H2>Operation</H2>

<PRE>
AL := AH * 10 + AL;
AH := 0;
</PRE>

<H2>Description</H2>

AAD is used to prepare two unpacked BCD digits (the least-significant
digit in AL, the most-significant digit in AH) for a division operation that
will yield an unpacked result. This is accomplished by setting AL to
AL + (10 * AH), and then setting AH to 0. AX is then equal to the binary
equivalent of the original unpacked two-digit number.

<H2>Flags Affected</H2>

SF, ZF, and PF as described in <A HREF="appc.htm">Appendix C</A>; OF, AF, and CF are undefined

<H2>Protected Mode Exceptions</H2>

None

<H2>Real Address Mode Exceptions</H2>

None

<H2>Virtual 8086 Mode Exceptions</H2>

None


<P>
<HR>
<P>
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="AAA.htm"> AAA ASCII Adjust after Addition</A><BR>
<B>next:</B><A HREF="AAM.htm"> AAM ASCII Adjust AX after Multiply</A>
</BODY>
